<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2021-06-10 16:01:43
 * @Description: 商品表
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-08-28 09:52:49
 * @FilePath: /qingshanERP/database/migrations/qingshanerp/2021_06_10_160143_create_goods.php
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGoods extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->id();
            $table->foreignId('tenant_id')->default(0)->comment('租户id');
            $table->tinyInteger('type')->default(1)->comment('平台类型，1 淘宝，2 天猫，3 京东，4 拼多多');
            $table->integer('shop_id')->default(0)->comment('店铺ID');
            $table->string('goods_id')->default(0)->comment('商品编码');
            $table->string('goods_name')->default('')->comment('商品名称');
            $table->string('thumb_url')->default('')->comment('商品缩略图');
            $table->string('image_url')->default('')->comment('商品图片');
            $table->tinyInteger('is_more_sku')->default(0)->comment('是否多sku，0-单sku，1-多sku');
            $table->boolean('is_onsale')->default(1)->comment('是否在架上，0-下架中，1-架上');
            $table->boolean('del_flag')->default(0)->comment('删除状态，1 删除，0 未删除');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
